package cn.empcode.prototype;

public class PrototypeTest {

	public static void main(String[] args) {
		comparePrototype2();
	}

	public static void comparePrototype2() {
		ConcretePrototype prototype1 = new ConcretePrototype();
		ConcretePrototype prototype2 = prototype1;

		System.out.println(prototype1.getAttr());
		System.out.println(prototype2.getAttr());

		System.out.println(prototype1.equals(prototype2));
	}

	public static void comparePrototype1() {
		ConcretePrototype prototype1 = new ConcretePrototype();
		prototype1.setAttr("zhang san");
		ConcretePrototype prototype2 = prototype1.clone();

		System.out.println(prototype1.getAttr());
		System.out.println(prototype2.getAttr());

		System.out.println(prototype1.equals(prototype2));
	}
}
